<?php /* Smarty version 2.6.14, created on 2012-10-18 00:20:33
         compiled from admin_faq.tpl */
?><?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'replace', 'admin_faq.tpl', 28, false),)), $this);
?><?php
SELanguage::_preload_multi(935,936,104,937,939,940,941,942,153,187,155,943,950,949,951,953,952,954,956,955,175,39,945,944,258,947,948,107,946,938);
SELanguage::load();
?><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'admin_header.tpl', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>


<h2><?php echo SELanguage::_get(935); ?></h2>
<?php echo SELanguage::_get(936); ?>

<br><br>

<input type='button' class='button' value='<?php echo SELanguage::_get(104); ?>' onClick='addCategory();'>
<input type='button' class='button' value='<?php echo SELanguage::_get(937); ?>' onClick='addQuestion();'>

<br><br>

<table cellpadding='0' cellspacing='0' class='list'>
<tr>
<td class='header'><?php echo SELanguage::_get(939); ?></td>
<td class='header' align='center' nowrap='nowrap'><?php echo SELanguage::_get(940); ?></td>
<td class='header' align='center' nowrap='nowrap'><?php echo SELanguage::_get(941); ?></td>
<td class='header' align='center' nowrap='nowrap'><?php echo SELanguage::_get(942); ?></td>
<td class='header' width='150'><?php echo SELanguage::_get(153); ?></td>
</tr>
<?php unset($this->_sections['faqcat_loop']);
$this->_sections['faqcat_loop']['name'] = 'faqcat_loop';
$this->_sections['faqcat_loop']['loop'] = is_array($_loop=$this->_tpl_vars['faqcats']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['faqcat_loop']['show'] = true;
$this->_sections['faqcat_loop']['max'] = $this->_sections['faqcat_loop']['loop'];
$this->_sections['faqcat_loop']['step'] = 1;
$this->_sections['faqcat_loop']['start'] = $this->_sections['faqcat_loop']['step'] > 0 ? 0 : $this->_sections['faqcat_loop']['loop']-1;
if ($this->_sections['faqcat_loop']['show']) {
    $this->_sections['faqcat_loop']['total'] = $this->_sections['faqcat_loop']['loop'];
    if ($this->_sections['faqcat_loop']['total'] == 0)
        $this->_sections['faqcat_loop']['show'] = false;
} else
    $this->_sections['faqcat_loop']['total'] = 0;
if ($this->_sections['faqcat_loop']['show']):

            for ($this->_sections['faqcat_loop']['index'] = $this->_sections['faqcat_loop']['start'], $this->_sections['faqcat_loop']['iteration'] = 1;
                 $this->_sections['faqcat_loop']['iteration'] <= $this->_sections['faqcat_loop']['total'];
                 $this->_sections['faqcat_loop']['index'] += $this->_sections['faqcat_loop']['step'], $this->_sections['faqcat_loop']['iteration']++):
$this->_sections['faqcat_loop']['rownum'] = $this->_sections['faqcat_loop']['iteration'];
$this->_sections['faqcat_loop']['index_prev'] = $this->_sections['faqcat_loop']['index'] - $this->_sections['faqcat_loop']['step'];
$this->_sections['faqcat_loop']['index_next'] = $this->_sections['faqcat_loop']['index'] + $this->_sections['faqcat_loop']['step'];
$this->_sections['faqcat_loop']['first']      = ($this->_sections['faqcat_loop']['iteration'] == 1);
$this->_sections['faqcat_loop']['last']       = ($this->_sections['faqcat_loop']['iteration'] == $this->_sections['faqcat_loop']['total']);
?>
  <tr class='background1'>
  <td class='item' colspan='4'><b><?php echo SELanguage::_get($this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqcat_title']); ?></b></td>
  <td class='item' style='font-weight: bold;' nowrap='nowrap'>
    <?php ob_start(); 
 echo SELanguage::_get($this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqcat_title']); 
 $this->_smarty_vars['capture']['default'] = ob_get_contents();  $this->assign('faqcat_title', ob_get_contents());ob_end_clean(); ?>
    <a href="javascript: editCategory('<?php echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqcat_id']; ?>
', '<?php echo ((is_array($_tmp=$this->_tpl_vars['faqcat_title'])) ? $this->_run_mod_handler('replace', true, $_tmp, "&#039;", "\&#039;") : smarty_modifier_replace($_tmp, "&#039;", "\&#039;")); ?>
');"><?php echo SELanguage::_get(187); ?></a>
     | <a href="javascript: confirmDeleteCat('<?php echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqcat_id']; ?>
');"><?php echo SELanguage::_get(155); ?></a>
    <?php if ($this->_sections['faqcat_loop']['first'] != TRUE): ?> | <a href='admin_faq.php?task=movecategory&faqcat_id=<?php echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqcat_id']; ?>
'><?php echo SELanguage::_get(943); ?></a><?php endif; ?>
  </td>
  </tr>

  <?php unset($this->_sections['faq_loop']);
$this->_sections['faq_loop']['name'] = 'faq_loop';
$this->_sections['faq_loop']['loop'] = is_array($_loop=$this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['faq_loop']['show'] = true;
$this->_sections['faq_loop']['max'] = $this->_sections['faq_loop']['loop'];
$this->_sections['faq_loop']['step'] = 1;
$this->_sections['faq_loop']['start'] = $this->_sections['faq_loop']['step'] > 0 ? 0 : $this->_sections['faq_loop']['loop']-1;
if ($this->_sections['faq_loop']['show']) {
    $this->_sections['faq_loop']['total'] = $this->_sections['faq_loop']['loop'];
    if ($this->_sections['faq_loop']['total'] == 0)
        $this->_sections['faq_loop']['show'] = false;
} else
    $this->_sections['faq_loop']['total'] = 0;
if ($this->_sections['faq_loop']['show']):

            for ($this->_sections['faq_loop']['index'] = $this->_sections['faq_loop']['start'], $this->_sections['faq_loop']['iteration'] = 1;
                 $this->_sections['faq_loop']['iteration'] <= $this->_sections['faq_loop']['total'];
                 $this->_sections['faq_loop']['index'] += $this->_sections['faq_loop']['step'], $this->_sections['faq_loop']['iteration']++):
$this->_sections['faq_loop']['rownum'] = $this->_sections['faq_loop']['iteration'];
$this->_sections['faq_loop']['index_prev'] = $this->_sections['faq_loop']['index'] - $this->_sections['faq_loop']['step'];
$this->_sections['faq_loop']['index_next'] = $this->_sections['faq_loop']['index'] + $this->_sections['faq_loop']['step'];
$this->_sections['faq_loop']['first']      = ($this->_sections['faq_loop']['iteration'] == 1);
$this->_sections['faq_loop']['last']       = ($this->_sections['faq_loop']['iteration'] == $this->_sections['faq_loop']['total']);
?>
    <tr class='background2'>
    <td class='item' style='padding-left: 30px;'><?php echo SELanguage::_get($this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_subject']); ?></td>
    <td class='item' align='center'><a href='#' onClick="<?php echo 'if(confirm(\''; 
 echo SELanguage::_get(950); 
 echo '\')) { location.href=\'admin_faq.php?task=resetviews&faq_id='; 
 echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_id']; 
 echo '\'; }'; ?>
" title='<?php echo sprintf(SELanguage::_get(949), $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_views']); ?>'><?php echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_views_average']; ?>
</a></td>
    <td class='item' align='center'><?php echo $this->_tpl_vars['datetime']->cdate(($this->_tpl_vars['setting']['setting_dateformat']),$this->_tpl_vars['datetime']->timezone(($this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_datecreated']),$this->_tpl_vars['setting']['setting_timezone'])); ?>
</td>
    <td class='item' align='center'><?php if ($this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_dateupdated'] != 0): 
 echo $this->_tpl_vars['datetime']->cdate(($this->_tpl_vars['setting']['setting_dateformat']),$this->_tpl_vars['datetime']->timezone(($this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_dateupdated']),$this->_tpl_vars['setting']['setting_timezone'])); 
 endif; ?>&nbsp;</td>
    <td class='item' nowrap='nowrap'>
      <?php ob_start(); 
 echo SELanguage::_get($this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_subject']); 
 $this->_smarty_vars['capture']['default'] = ob_get_contents();  $this->assign('faq_subject', ob_get_contents());ob_end_clean(); ?>
      <?php ob_start(); 
 echo SELanguage::_get($this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_content']); 
 $this->_smarty_vars['capture']['default'] = ob_get_contents();  $this->assign('faq_content', ob_get_contents());ob_end_clean(); ?>
      <a href="javascript:editQuestion('<?php echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_id']; ?>
', '<?php echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqcat_id']; ?>
', '<?php echo ((is_array($_tmp=$this->_tpl_vars['faq_subject'])) ? $this->_run_mod_handler('replace', true, $_tmp, "&#039;", "\&#039;") : smarty_modifier_replace($_tmp, "&#039;", "\&#039;")); ?>
', '<?php echo ((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['faq_content'])) ? $this->_run_mod_handler('replace', true, $_tmp, "&#039;", "\&#039;") : smarty_modifier_replace($_tmp, "&#039;", "\&#039;")))) ? $this->_run_mod_handler('replace', true, $_tmp, "'", "\'") : smarty_modifier_replace($_tmp, "'", "\'")))) ? $this->_run_mod_handler('replace', true, $_tmp, '"', '&quot;') : smarty_modifier_replace($_tmp, '"', '&quot;')))) ? $this->_run_mod_handler('replace', true, $_tmp, "<", "&lt;") : smarty_modifier_replace($_tmp, "<", "&lt;")))) ? $this->_run_mod_handler('replace', true, $_tmp, ">", "&gt;") : smarty_modifier_replace($_tmp, ">", "&gt;")); ?>
');"><?php echo SELanguage::_get(187); ?></a>
       | <a href="javascript: confirmDeleteQuest('<?php echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_id']; ?>
');"><?php echo SELanguage::_get(155); ?></a>
      <?php if ($this->_sections['faq_loop']['first'] != TRUE): ?> | <a href='admin_faq.php?task=movequestion&faq_id=<?php echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqs'][$this->_sections['faq_loop']['index']]['faq_id']; ?>
'><?php echo SELanguage::_get(943); ?></a><?php endif; ?>
    </td>
    </tr>
  <?php endfor; endif; 
 endfor; endif; ?>
</table>

<?php echo '
<script type="text/javascript">
<!-- 
var faqcat_id = 0;
function addCategory() {
  $(\'cat_title\').value = \'\';
  $(\'cat_title\').defaultValue = \'\';
  $(\'faqcat_id\').value = 0;
  $(\'faqcat_task\').value = "addcategory";
  $(\'faqcat_submit\').value = "'; 
 echo SELanguage::_get(104); 
 echo '";
  TB_show(\''; 
 echo SELanguage::_get(104); 
 echo '\', \'#TB_inline?height=250&width=350&inlineId=addcategory\', \'\', \'../images/trans.gif\');
}

function editCategory(id, title) {
  $(\'cat_title\').value = title;
  $(\'cat_title\').defaultValue = title;
  $(\'faqcat_id\').value = id;
  $(\'faqcat_task\').value = "editcategory";
  $(\'faqcat_submit\').value = "'; 
 echo SELanguage::_get(951); 
 echo '";
  TB_show(\''; 
 echo SELanguage::_get(951); 
 echo '\', \'#TB_inline?height=250&width=350&inlineId=addcategory\', \'\', \'../images/trans.gif\');
}

function confirmDeleteCat(id) {
  faqcat_id = id;
  faq_id = 0;
  $(\'confirm_message\').innerHTML = \''; 
 echo SELanguage::_get(953); 
 echo '\';
  TB_show(\''; 
 echo SELanguage::_get(952); 
 echo '\', \'#TB_inline?height=150&width=300&inlineId=confirmdelete\', \'\', \'../images/trans.gif\');
}


var faq_id = 0;
function addQuestion() {
  $(\'faq_faqcat_id\').options[0].defaultSelected = true;
  $(\'faq_subject\').value = \'\';
  $(\'faq_subject\').defaultValue = \'\';
  $(\'faq_content\').value = \'\';
  $(\'faq_content\').defaultValue = \'\';
  $(\'faq_id\').value = 0;
  $(\'faq_task\').value = "addquestion";
  $(\'faq_submit\').value = "'; 
 echo SELanguage::_get(937); 
 echo '";
  TB_show(\''; 
 echo SELanguage::_get(937); 
 echo '\', \'#TB_inline?height=350&width=450&inlineId=addquestion\', \'\', \'../images/trans.gif\');
}

function editQuestion(id, cat_id, subject, content) {
  $(\'faq_faqcat_id\').value = cat_id;
  $(\'faq_faqcat_id\').options[$(\'faq_faqcat_id\').selectedIndex].defaultSelected = true;
  $(\'faq_subject\').value = subject;
  $(\'faq_subject\').defaultValue = subject;
  $(\'faq_content\').value = content;
  $(\'faq_content\').defaultValue = content;
  $(\'faq_id\').value = id;
  $(\'faq_task\').value = "editquestion";
  $(\'faq_submit\').value = "'; 
 echo SELanguage::_get(954); 
 echo '";
  TB_show(\''; 
 echo SELanguage::_get(954); 
 echo '\', \'#TB_inline?height=350&width=450&inlineId=addquestion\', \'\', \'../images/trans.gif\');
}

function confirmDeleteQuest(id) {
  faq_id = id;
  faqcat_id = 0;
  $(\'confirm_message\').innerHTML = \''; 
 echo SELanguage::_get(956); 
 echo '\';
  TB_show(\''; 
 echo SELanguage::_get(955); 
 echo '\', \'#TB_inline?height=150&width=300&inlineId=confirmdelete\', \'\', \'../images/trans.gif\');
}



function deletedo() {
  if(faq_id != 0) {
    window.location = \'admin_faq.php?task=deletequestion&faq_id=\'+faq_id;
  } else if(faqcat_id != 0) {
    window.location = \'admin_faq.php?task=deletecategory&faqcat_id=\'+faqcat_id;
  }
}

//-->
</script>
'; ?>



<div style='display: none;' id='confirmdelete'>
  <div style='margin-top: 10px;' id='confirm_message'>
    <?php echo SELanguage::_get(953); ?>
  </div>
  <br>
  <input type='button' class='button' value='<?php echo SELanguage::_get(175); ?>' onClick='parent.TB_remove();parent.deletedo();'> <input type='button' class='button' value='<?php echo SELanguage::_get(39); ?>' onClick='parent.TB_remove();'>
</div>


<div style='display: none;' id='addcategory'>
  <form action='admin_faq.php' method='post' target='_parent' onSubmit="<?php echo 'if(this.cat_title.value == \'\'){ alert(\''; 
 echo SELanguage::_get(945); 
 echo '\'); return false;}else{return true;}'; ?>
">
  <div style='margin-top: 10px;'><?php echo SELanguage::_get(944); ?></div>
  <br>
  <table cellpadding='0' cellspacing='0'>
  <tr>
  <td align='right' class='form1'><?php echo SELanguage::_get(258); ?>:&nbsp;</td>
  <td class='form2'><input type='text' class='text' name='cat_title' id='cat_title' size='30' maxlength='50'></td>
  </tr>
  <tr>
  <td class='form1'>&nbsp;</td>
  <td class='form2'>
    <input type='submit' class='button' id='faqcat_submit' value='<?php echo SELanguage::_get(104); ?>'> <input type='button' class='button' value='<?php echo SELanguage::_get(39); ?>' onClick='parent.TB_remove();'>
    <input type='hidden' name='task' id='faqcat_task' value='addcategory'>
    <input type='hidden' name='faqcat_id' id='faqcat_id' value='0'>
    </form>
  </td>
  </tr>
  </table>
</div>


<div style='display: none;' id='addquestion'>
  <form action='admin_faq.php' method='post' target='_parent' onSubmit="<?php echo 'if(this.faq_subject.value == \'\'){ alert(\''; 
 echo SELanguage::_get(947); 
 echo '\'); return false;}else{return true;}'; ?>
">
  <div style='margin-top: 10px;'><?php echo SELanguage::_get(948); ?></div>
  <br>
  <table cellpadding='0' cellspacing='0' width='100%'>
  <tr>
  <td class='form1' align='right'><?php echo SELanguage::_get(107); ?>&nbsp;</td>
  <td class='form2'>
    <select name='faqcat_id' id='faq_faqcat_id' class='text'>
    <?php unset($this->_sections['faqcat_loop']);
$this->_sections['faqcat_loop']['name'] = 'faqcat_loop';
$this->_sections['faqcat_loop']['loop'] = is_array($_loop=$this->_tpl_vars['faqcats']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['faqcat_loop']['show'] = true;
$this->_sections['faqcat_loop']['max'] = $this->_sections['faqcat_loop']['loop'];
$this->_sections['faqcat_loop']['step'] = 1;
$this->_sections['faqcat_loop']['start'] = $this->_sections['faqcat_loop']['step'] > 0 ? 0 : $this->_sections['faqcat_loop']['loop']-1;
if ($this->_sections['faqcat_loop']['show']) {
    $this->_sections['faqcat_loop']['total'] = $this->_sections['faqcat_loop']['loop'];
    if ($this->_sections['faqcat_loop']['total'] == 0)
        $this->_sections['faqcat_loop']['show'] = false;
} else
    $this->_sections['faqcat_loop']['total'] = 0;
if ($this->_sections['faqcat_loop']['show']):

            for ($this->_sections['faqcat_loop']['index'] = $this->_sections['faqcat_loop']['start'], $this->_sections['faqcat_loop']['iteration'] = 1;
                 $this->_sections['faqcat_loop']['iteration'] <= $this->_sections['faqcat_loop']['total'];
                 $this->_sections['faqcat_loop']['index'] += $this->_sections['faqcat_loop']['step'], $this->_sections['faqcat_loop']['iteration']++):
$this->_sections['faqcat_loop']['rownum'] = $this->_sections['faqcat_loop']['iteration'];
$this->_sections['faqcat_loop']['index_prev'] = $this->_sections['faqcat_loop']['index'] - $this->_sections['faqcat_loop']['step'];
$this->_sections['faqcat_loop']['index_next'] = $this->_sections['faqcat_loop']['index'] + $this->_sections['faqcat_loop']['step'];
$this->_sections['faqcat_loop']['first']      = ($this->_sections['faqcat_loop']['iteration'] == 1);
$this->_sections['faqcat_loop']['last']       = ($this->_sections['faqcat_loop']['iteration'] == $this->_sections['faqcat_loop']['total']);
?>
      <option value='<?php echo $this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqcat_id']; ?>
'><?php echo SELanguage::_get($this->_tpl_vars['faqcats'][$this->_sections['faqcat_loop']['index']]['faqcat_title']); ?></option>
    <?php endfor; endif; ?>
    </select>
  </td>
  </tr>
  <tr>
  <td class='form1' align='right'><?php echo SELanguage::_get(946); ?>&nbsp;</td>
  <td class='form2'><input type='text' class='text' name='faq_subject' id='faq_subject' size='50'></td>
  </tr>
  <tr>
  <td class='form1' align='right' valign='top'><?php echo SELanguage::_get(938); ?>&nbsp;</td>
  <td class='form2'><textarea name='faq_content' id='faq_content' rows='10' cols='45'></textarea></td>
  </tr>
  <tr>
  <td class='form1'>&nbsp;</td>
  <td class='form2'>
    <input type='submit' class='button' id='faq_submit' value='<?php echo SELanguage::_get(937); ?>'> <input type='button' class='button' value='<?php echo SELanguage::_get(39); ?>' onClick='parent.TB_remove();'>
    <input type='hidden' name='task' id='faq_task' value='addquestion'>
    <input type='hidden' name='faq_id' id='faq_id' value='0'>
    </form>
  </td>
  </tr>
  </table>

</div>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'admin_footer.tpl', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>